package sy.services.impl;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import sy.db.mysql.dao.TbugDao;
import sy.db.mysql.model.Tbug;
import sy.pageModel.Bug;
import sy.pageModel.DataGrid;
import sy.services.BugServiceI;

@Service
public class BugServiceImpl implements BugServiceI {
	@Autowired
	TbugDao tbugDao;
	@Override
	public DataGrid dataGrid(Map map) {
		DataGrid dataGrid = new DataGrid();
		map.put("dataGrid", dataGrid);
		dataGrid.setRows(tbugDao.findbyByGrid(map));
		return dataGrid;
	}

	@Override
	public void add(Tbug bug) {
		this.tbugDao.insertSelective(bug);
	}

	@Override
	public Tbug get(String id) {
		return this.tbugDao.selectByPrimaryKey(id);
	}

	@Override
	public void edit(Tbug bug) {
		this.tbugDao.updateByPrimaryKeySelective(bug);
		
	}

	@Override
	public void delete(String id) {
		this.tbugDao.deleteByPrimaryKey(id);
		
	}
	
	
}
